{{ template "frontheader" . }}

<div class="login-box" >
    <form class="layui-form layui-form-pane" method="get" action="">
        <div class="layui-form-item" style="padding-bottom: 25px">
            <h3>品茗代码自动生成系统登录</h3>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">账号：</label>

            <div class="layui-input-inline">
                <input type="text" id="Username" name="Username" class="layui-input" lay-verify="Username" placeholder="账号" autocomplete="on" maxlength="20"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码：</label>

            <div class="layui-input-inline">
                <input type="password" id="Password" name="Password" class="layui-input" lay-verify="Password" placeholder="密码" maxlength="20"/>
            </div>
        </div>
       {{/* <div class="layui-form-item">
            <label class="layui-form-label">验证码：</label>
            <div class="layui-input-inline">
                <input type="number" name="code"
                       class="layui-input" lay-verify="code" placeholder="验证码" maxlength="4"/>
                <img src="img/v.png" onclick="getImage()" title="单击刷新验证码" id="img_rand_code" alt="">
            </div>
        </div>*/}}
        <div class="layui-form-item">
            <button type="button" style="width: 300px"
                    class="layui-btn btn-submit layui-btn-lg"
                     onclick="login()">立即登录</button>
        </div>
    </form>
</div>

{{ template "footer" . }}
<script type="text/javascript">
    function login() {
        var data={
            "Username":$("#Username").val(),
            "Password":$("#Password").val(),
        };
        $.scopeAjax({
            url:"/login",
            params:data,
            successCallback:function (result) {
                console.log(result)
                location.href="/"
            }
        })
    }
</script>